#include "HardwareProfile.h"
#define Key_Mode 0x01
#define Key_Enter 0x02
void KeyProc(void)
{
	unsigned char key;	
	unsigned char i,j,bErr;
	unsigned int TSum,PSum,p,t;
	key=KeyCheck();
	if(key==NoKey)
		return;	
	switch(key)
	{
	case Key_Mode:
		PageIndex++;
		if(PageIndex>10)
			PageIndex=1;		
		if(CP1616_MasterWaitClientData(PageIndex,1,0,0)==1)
		{
			for(i=0;i<4;i++)
				FireTime[PageIndex].u8s[i]=CP1616_Master_RxList[pCP1616_MasterData+i];
			FireTimeReaded[PageIndex]=1;
		}
		else
			FireTimeReaded[PageIndex]=0;
		Display_VariablePage();
		break;
	case Key_Enter:		
		PageIndex--;
		if(PageIndex<1)
			PageIndex=10;	
		if(PageIndex>10)
			PageIndex=10;
		if(CP1616_MasterWaitClientData(PageIndex,1,0,0)==1)
		{
			for(i=0;i<4;i++)
				FireTime[PageIndex].u8s[i]=CP1616_Master_RxList[pCP1616_MasterData+i];
			FireTimeReaded[PageIndex]=1;
		}
		else
			FireTimeReaded[PageIndex]=0;
		Display_VariablePage();
		break;
	}
}


